package com.yunduansing.core.dao;

import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.yunduansing.core.commons.DbCommon;
import com.yunduansing.core.model.TemplateTypeModel;
import com.yunduansing.core.utils.CoreMapper;

public interface TemplateTypeDao {
	List<TemplateTypeModel> pagination(@Param(value="grid") DbCommon.Grid grid,@Param(value="key") String key);
	/*@Select("select count(*) from sys_template_type")*/
	int pageCount(@Param(value="key") String key);
	@Insert("insert into sys_template_type(name,code,status) values(#{name},#{code},#{status})")
	boolean add(TemplateTypeModel model);
	@Update("update sys_template_type set name=#{name},code=#{code},status=#{status} where id=#{id}")
	boolean update(TemplateTypeModel model);
	@Select("select * from sys_template_type where id=#{id}")
	TemplateTypeModel getById(int id);
	boolean delete(List<Integer> ids);
	@Select("select * from sys_template_type where status=1")
	List<TemplateTypeModel> getAll();
}
